import { defineStore } from 'pinia'

export const useCountStore = defineStore('count', {
  actions: {
    increment(val: number) {
      this.sum += val
    },
  },
  // 真正存储数据的地方
  state() {
    return {
      sum: 6,
      name: 'zhangsan',
    }
  },
  getters: {
    bigSum: (state) => state.sum * 10,
    upperName(): string {
      return this.name.toUpperCase()
    },
  },
})
